﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;


namespace AngleExpress.converter
{
    [ValueConversion(typeof(bool), typeof(Brush))]
    class ForegroundConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool selected = (bool)value;
            if (selected)
                return new SolidColorBrush(Color.FromRgb(0xFF, 0xFF, 0xFF));
            else
                return new SolidColorBrush(Color.FromRgb(0,0,0));
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
